<!--
 * @Author: 张宇捷
 * @Date: 2025-10-11 14:33:02
 * @LastEditors: 张宇捷
 * @LastEditTime: 2025-10-11 14:35:01
 * @Description: 文件描述
-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>操作DOM的DEMO</title>
</head>
<body>
    <span id="textBox">0</span>
    <br>
    <button id="addBtn">+累加</button>
    <script>
        // 想要操作谁就获取谁的DOM
        let textBox = document.getElementById('textBox');
        let addBtn = document.getElementById('addBtn');
        addBtn.onclick = function () {
            textBox.innerHTML = parseInt(textBox.innerHTML) + 1;
        }
    </script>
</body>
</html>